<?php

	/*session_start();
	if(!isset($_SESSION['user']))
	{
		header('location:login.html');
	}*/
	//定义一个md5同行证号，在所有ajax中发送到所有action中，action先判断有没有这个同行证号，没有的话则是非法访问
	define("ACC",md5('welcome'));
	define('ROOT',str_replace('\\','/',str_replace('index2.php','',__FILE__)));
	function tree($dir)
	{
		static $str='';
		$mydir = dir($dir);
		while($file = $mydir->read())
		{
			if($file != '.' && $file != '..')
			{
				if(is_dir("$dir/$file"))
				{
					tree("$dir/$file");
				}else{
					
					$f=trim(str_replace(ROOT,'',$dir).'/'.$file,'/');
					if(allowext($f)&&!strpos($f,'UserHead'))
					{
						$str.="['{$f}'],";
					}
				}
			}
		}
		$mydir->close();
		return $str;
	}
	function allowext($file)
	{
		$exts=array(
		'bmp',
		'png',
		'jpg',
		'jpeg',
		'gif',
		);
		$ext=strtolower(substr(strrchr($file, '.'), 1));
		
		if(in_array($ext,$exts))
		{
			return true;
		}
		return false;
	}
	
	
?>

<!doctype html>
<html lang="en">
 <head>
 <script type="text/javascript">
 
 </script>
  <meta charset="UTF-8">
  <meta name="renderer" content="webkit">
  <meta name="Generator" content="notepad">
  <meta name="Author" content="lajiao">
  <meta http-equiv="Cache-Control" content="max-age=15552000" />
<!--<meta http-equiv="Expires" content="Mon, 20 Jul 2016 23:00:00 GMT" />-->
  <meta name="Keywords" content="Fake QQ 社交 聊天 在线 交友">
  <meta name="Description" content="">
  <script type="text/javascript" src="js/jquery.js"></script>
  <title>FakeQQ--肥QQ,在线聊天平台</title>
  
  <style type="text/css" >
	#preloadboard
	{
		position:fixed;
		top:0;
		left:0;
		z-index:10000000000000000000000000000000000000000000000000000000;
		width:100%;
		height:100%;
		padding:0;
		margin:0;
		background:white;
		font-family:'微软雅黑';
	}
	#preloadboard .preloadtext{
		width:800px;
		height:100px;
		line-height:100px;
		text-align:center;
		margin:100px auto auto auto;
		color:#0099FF;
		font-size:60px;
		
	}
	#preloadboard .preloadbox{
		width:800px;
		
		line-height:100px;
		text-align:center;
		margin:20px auto auto auto;
		color:#0099FF;
		font-size:16px;
	}
	#preloadboard .preloadbox .preloadframe{
		width:100%;
		width:400px;
		margin:0 auto;
		height:6px;
		border-radius:3px;
		-moz-border-radius:3px;
		-webkit-border-radius:3px;
		-moz-box-shadow:inset 0px 1px 6px #666;  
		-webkit-box-shadow:inset 0px 1px 6px #666;   
		box-shadow:inset 0px 1px 6px #666;
	}
	#preloadboard .preloadbox .preloadframe .preloadblock{
		width:0%;
		height:100%;
		background:#0099FF;
		border-radius:3px;
		-moz-border-radius:3px;
		-webkit-border-radius:3px;
		-moz-box-shadow:inset 0px 0px 5px #0099CC;  
		-webkit-box-shadow:inset 0px 0px 5px #0099CC;   
		box-shadow:inset 0px 0px 5px #0099CC;
	}
	#preloadboard .preloadbox .preloadcallbacktext{
		font-size:13px;
	}
	.script
	{
		display:none;
	}
	audio
	{
		width:0;
		height:0;
		display:none;
	}
	.preload_link{
		color:red;
		text-decoration:none;
	}
	.preload_link:hover{
		color:red;
		text-decoration:underline;
	}
	
  </style>



 </head>

 <body>
<div id="preloadboard">
	<div class="preloadtext">ONLY for TEST</div>
	<div class="preloadbox">
		<div id="preloadwaitingtips">请稍待片刻...</div>
		<div class="preloadframe"><div class="preloadblock"></div></div>
		<div class="preloadcallbacktext">等待网页加载完毕...</div>
		<div class="preloaderrorlog">
			
		</div>
	</div>
</div>
<div id="preload_checker">
	<div id="preload_css_check"></div>
</div>
  <!--整体页-->
  <div id="all">
	<!--顶部提示页-->
	<div id="info"></div>

	<!--切换页面，暂时不用-->
	<div id="page1"></div>
	<div id="page2"></div>
	<div id="page3"></div>

	<!--聊天主面板-->
	<div id="chat">
		<div id="bar"></div>
		<!--正在聊天联系人面板-->
		<div id="chating">
			
		</div>
		<!--当前聊天面板-->
		<div class="cut_chat" >
		<div class="page">
			<div class="chat_top"></div>
			<div class="chat_box"></div>
			<div class="chat_input">
				<textarea class="input"></textarea>
				<div class="send">发送</div>
			</div>
			</div>
		</div>
		<!--聊天记录-->
		<div id="chat_log">
			
		</div>
	</div>

	

	<!--底部状态栏-->
	<div id="foot_status"></div>

  </div>
 
<!--设置面板-->
	<div id="setboard"></div>








<!--桌面图标-->
<div class="deskicoboard">
	<div class="deskico" id="qqex" title="D:/tencent/QQ"><img src="img/qq_48.png"/>QQ</div>

	<div class="deskico" id="radioex" title="D:/Program Files/NetRadio/radio"><img src="img/ext/fm/radio_red2.png"/>音乐电台</div>
	
	<div class="deskico" id="browserex" title="D:/Program Files/椒椒浏览器"><img src="img/ext/fm/radio_black.png"/>椒椒浏览器</div>



	<div class="deskico" id="testbtn" title="测试按钮"><img src="img/qq_48.png"/>测试按钮</div>
</div>


<!--玻璃遮盖层-->
<div class="whiteglass"></div>
<div class="glass"></div>
<!--底部状态栏-->
<div id="bottombar">
	<div id="start"></div>
	<div id="sysapp">
		<div id="showdesk"></div>
		<div id="clockico">23:10</div>
		<div id="soundico" class="soundon"></div>
		<div id="musicico"></div>
	</div>
	
	<div id="appcnt">
		
	</div>

	<div id="tinycontent">
		
	</div>
	<div class="clear"></div>
</div>

<div id="gobal_msg">
<!--
	<audio id="gotamsg" style="display:none;" controls>
		<source src="msg"/>
		<source src="msg"/>
	</audio>

	<audio id="gotashake" style="display:none;" controls>
		<source src="shake"/>
		<source src="shake"/>
	</audio>

	<audio id="gotatweet" style="display:none;" controls>
		<source src="tweet"/>
		<source src="tweet"/>
	</audio>

	<audio id="gotaglobal" style="display:none;" controls>
		<source src="Global"/>
		<source src="Global"/>
	</audio>
	<audio id="goading" style="display:none;" controls>
		<source src="WindowsDing"/>
		<source src="WindowsDing"/>
	</audio>
	<audio id="gotacall" style="display:none;" controls>
		<source src="Audio"/>
		<source src="Audio"/>
	</audio>
	<audio id="gotasys" style="display:none;" controls>
		<source src="system"/>
		<source src="system"/>
	</audio>
-->
</div>

<script type="text/javascript" src="js/desk.js"></script>
  <script type="text/javascript">

	//禁用右键、文本选择功能、复制按键  
    $(document).bind("contextmenu",function(e){
		//console.log(e.target);
		if(e.target.id)
		{
			console.log(e.target.id);
			if(e.target.id.indexOf('qqicoimg_')>=0||e.target.id=='qqnewimg')
			{
				//console.log('右击图标'+$(e.target)[0]);
				new StatusBox().init(e.target);
			}
			else if(e.target.id.indexOf('mainboard_openintrocard_')>=0)
			{
				openMainheadselectbox(e.target,e.pageX,e.pageY);
			}
		}
		return false;
	
	});
	//当网页中某一元素开启contenteditable="true"可编辑div的时候，千万不要使用这个函数
    $(document).bind("selectstart",function(e){
			if(e.target.id.indexOf('inputbox')<0)
			{
				return false;
			}
		});  

window.onbeforeunload=function()
{
	return "确认退出登录状态并关闭页面？";
}


/*
每隔2秒请求对方是否正在输入状态
*/

/*
每隔10秒请求系统消息（加好友，官方通知等)
*/

  </script>
 
   
	
	 </body>
</html>
<script type="text/javascript">

//同行证号
var ACC=
{
	code:"<?php echo ACC;?>",
};


window.onload = function() {
		
		var preload_tip_arr=[
		'你知道吗？',
		'使用更大分辨率浏览器，体验更好',
		'本程序作者写了一年多',
		'请不要使用真实QQ号注册',
		'加载中如果有特殊问题，请关闭广告屏蔽软件试试',
		'发现Bug?反馈QQ：1541402854',
		];
	
	
		__preloadtips_func(preload_tip_arr);
	
	
		var preload = [
				[
					'css/allin.css',
				],
				[
					//'js/jquery.js',
					'js/jquery.md5.js',
					'js/include.js',
					'js/msgcenter.js',
					'js/msgsend.js',
					'js/desk.js',
					'js/all.js',
					'js/login_html5.js',
					'js/lib/photobooth_min.js',
					'js/ext_radio.js'
				],
				
				[
					['gotamsg','msg'],
					['gotashake','shake'],
					['gotatweet','tweet'],			
					['gotaglobal','Global'],				
					['goading','WindowsDing'],		
					['gotacall','Audio'],		
					['gotasys','system']
				],
				
				[
					<?php echo tree(ROOT.'img/Calendar'),tree(ROOT.'img/chatframe'),tree(ROOT.'img/checkbutton'),tree(ROOT.'img/common'),tree(ROOT.'img/mainpanel'),tree(ROOT.'img/loginpanel'),tree(ROOT.'img/Menu'),tree(ROOT.'img/status'); ?>
				],
				
				
        ];
		__preloader(preload);
	
 
};


</script>
<script type="text/javascript">

function __preloadtips_func(arr)
{
	var arr=arr;
	var offset=0;
	var tip=$('#preloadwaitingtips');
	//console.log(tip);
	function __showtoboard()
	{
		if($('#preloadboard').length>0)
		{
			tip.fadeOut('slow',function()
			{
				offset+1>=arr.length?offset=0:++offset;
				tip.fadeIn('slow');
				tip.html(arr[offset]);
			});
			
			
			setTimeout(__showtoboard,4000);
		}
	}
	__showtoboard();
}


function __preloader(arr)
{
	var preloadarr=arr;
	
	var total=0;
	var sum=0;
	for(var i=0;i<preloadarr.length;i++)
	{
		total+=preloadarr[i].length;
	}
		
	var preloadcallbacktext=document.getElementsByClassName('preloadcallbacktext')[0];
	var preloadblock=document.getElementsByClassName('preloadblock')[0];
	preloadcallbacktext.innerHTML='计算所需文件...';
	
	var preloaderrorlog=document.getElementsByClassName('preloaderrorlog')[0];
	
	var type=0;
	var offset=0;
	
	function include_node(preload) {
		
		var node=add(type,preload[type][offset]);
		
		//console.log(offset+','+preload[type].length+'-------load:'+preload[type][offset]);
	
		if(type<4)
		{
			try
			{	
				var flag=true;
				node.onload = node.onreadystatechange=node.onloadedmetadata = function()
				{
				// !this.readyState 为不支持onreadystatechange的情况，或者OP下创建CSS的情况
				// this.readyState === "loaded" 为IE/OP下创建JS的时候
				// this.readyState === "complete" 为IE下创建CSS的时候
					//console.log('readyState='+this.readyState);
						if (!this.readyState || this.readyState === "loaded" || this.readyState === "complete"||this.readyState===1||this.readyState===4) {
								node.onload = node.onreadystatechange = null; //防止IE内存泄漏
								
								if(flag)
								{
									++sum;
									preloadblock.style.width=(sum/total)*100+'%';
									preloadcallbacktext.innerHTML='加载'+type+'.'+offset+'... 总进度:'+sum+'/'+total;
									//flag=false;
									++offset;
									//console.log(preload[offset]);
									
									if(offset<preload[type].length)
									{
										include_node(preload);
									}
									else if(offset==preload[type].length)
									{
										if((type+1)!=preload.length)
										{
											++type;
											offset=0;
											include_node(preload);
										}
										else
										{
											preloadcallbacktext.innerHTML='加载完成，正在进入...';
											setTimeout(function()
											{
												$('#preloadboard').fadeOut('slow',function()
												{
													window.preload_flag=true;
													$(this).remove();
												});
											},1500);
											return false;
										}
									}
								}
								
						}
				}
				node.onerror=function()
				{
					setTimeout(function(){
					preloadblock.style.width=(sum/total)*100+'%';
					preloadcallbacktext.innerHTML='<font color="red">加载'+type+'.'+offset+'失败</font>，重新加载中...,<a class="preload_link" target="_blank" href="https://www.baidu.com/s?ie=UTF-8&wd=%E5%85%B3%E9%97%ADabp">关闭ABP</a>或<a class="preload_link" href="javascript:void(location.reload());">刷新网页</a>试试。 总进度:'+sum+'/'+total;
					include_node(preload);
					},500);
									
				}
			}catch(e)
			{
				var _error="name: " + e.name + 
      "message: " + e.message + 
      "lineNumber: " + e.lineNumber + 
      "fileName: " + e.fileName + 
      "stack: " + e.stack; 
				preloaderrorlog.innerHTML=_error;
			}
			
			
			
		}else if(type==3)
		{
					
		}
		
		
		return false;
	}

	function add(num,name)
	{
		var url='http://localhost/p0001new2/';
		//var url='http://fakeqq.win/';
		var _doc = document.getElementsByTagName('head')[0];
		var node=0;
		if(num==0)
		{
			node = document.createElement('link');
			node.type = "text/css";
			node.rel  = "stylesheet";
			node.href = url+name;
			_doc.appendChild(node);
		}
		else if(num==1)
		{
			node = document.createElement('script');
			node.type = "text/javascript";
			node.src  = url+name;
			_doc.appendChild(node);
		}
		else if(num==2)
		{
			var audio=document.getElementById('gobal_msg');
			node = document.createElement('audio');
			node.id = name[0];
			node.controls  = 'controls';

			
			var sr= document.createElement("source");
			sr.src= url+'Classic/'+name[1]+'.ogg';
			node.appendChild(sr);
			var sr= document.createElement("source");
			sr.src= url+'Classic/'+name[1]+'.wav';
			node.appendChild(sr);
			
			audio.appendChild(node);
		}
		else if(num==3)
		{
			var node=new Image();
			node.src=url+name;
		}

		
		return node;
	}
	
	include_node(preloadarr);
	
	
}
</script>
	<!--<script type="text/javascript" src="js/include.js"></script>
<script type="text/javascript" src="js/msgcenter.js"></script>
<script type="text/javascript" src="js/msgsend.js"></script>
<script type="text/javascript" src="js/desk.js"></script>

	<script type="text/javascript" src="js/all.js"></script>
	<script id="ext_radio_js" type="text/javascript" src="js/ext_radio.js"></script>
	<script id="login_html5_js" type="text/javascript" src="js/login_html5.js"></script>
	<script id="photobooth_js" type="text/javascript" src="js/lib/photobooth_min.js"></script>

-->

